<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MRSL Motion Primitive Library: include/mpl_traj_solver/poly_solver.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MRSL Motion Primitive Library
   &#160;<span id="projectnumber">1.2</span>
   </div>
   <div id="projectbrief">A motion primitive library for generating trajectory for mobile robots</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_8e76f29c55fc3c0dcffde3c31a52a0ea.html">mpl_traj_solver</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">poly_solver.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="poly__solver_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#ifndef MPL_POLY_SOLVER_H</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#define MPL_POLY_SOLVER_H</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="poly__traj_8h.html">mpl_traj_solver/poly_traj.h</a>&gt;</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &lt;Eigen/Core&gt;</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;Eigen/LU&gt;</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;Eigen/StdVector&gt;</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="keyword">template</span> &lt;<span class="keywordtype">int</span> Dim&gt;</div><div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="classPolySolver.html">   21</a></span>&#160;<span class="keyword">class </span><a class="code" href="classPolySolver.html">PolySolver</a> {</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;  <a class="code" href="classPolySolver.html#a9d8959bf5a5aa10e09eeff4fafad6412">PolySolver</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> smooth_derivative_order,</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;             <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> minimize_derivative, <span class="keywordtype">bool</span> debug = <span class="keyword">false</span>);</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classPolySolver.html#a794e1d7a1ce70b497a76aa92415757d3">solve</a>(<span class="keyword">const</span> <a class="code" href="data__type_8h.html#a6b9210d48a0a541940af71827aad1b41">vec_E</a>&lt;<a class="code" href="structWaypoint.html">Waypoint&lt;Dim&gt;</a>&gt;&amp; waypoints,</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;             <span class="keyword">const</span> std::vector&lt;decimal_t&gt;&amp; dts);</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;  std::shared_ptr&lt;PolyTraj&lt;Dim&gt;&gt; <a class="code" href="classPolySolver.html#a2848755828e352354d6740bde24e43ae">getTrajectory</a>();</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160; <span class="keyword">protected</span>:</div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="classPolySolver.html#a05e80fc467c2fd6ed86b2406b46cee8b">   45</a></span>&#160;  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classPolySolver.html#a05e80fc467c2fd6ed86b2406b46cee8b">N_</a>;</div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="classPolySolver.html#a3354e2810ae6f83328e38feffba66619">   47</a></span>&#160;  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classPolySolver.html#a3354e2810ae6f83328e38feffba66619">R_</a>;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;  <a class="code" href="data__type_8h.html#ab13729f7d29cc8284965c7c42129a45f">MatDf</a> A_;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;  <a class="code" href="data__type_8h.html#ab13729f7d29cc8284965c7c42129a45f">MatDf</a> Q_;</div><div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="classPolySolver.html#a513264833fd583e3c4f70552d36c0fdc">   51</a></span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classPolySolver.html#a513264833fd583e3c4f70552d36c0fdc">debug_</a>;</div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="classPolySolver.html#a18b1d7df17bc4c1d97c98448e1cc44bd">   53</a></span>&#160;  std::shared_ptr&lt;PolyTraj&lt;Dim&gt;&gt; <a class="code" href="classPolySolver.html#a18b1d7df17bc4c1d97c98448e1cc44bd">ptraj_</a>;</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;};</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;</div><div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="poly__solver_8h.html#a16c877e610ae28aec1b360b621bcfe31">   57</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="classPolySolver.html">PolySolver&lt;2&gt;</a> <a class="code" href="poly__solver_8h.html#a16c877e610ae28aec1b360b621bcfe31">PolySolver2D</a>;</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="poly__solver_8h.html#a72e2c516357976f331e97006c7abeef8">   60</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="classPolySolver.html">PolySolver&lt;3&gt;</a> <a class="code" href="poly__solver_8h.html#a72e2c516357976f331e97006c7abeef8">PolySolver3D</a>;</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="data__type_8h_html_ab13729f7d29cc8284965c7c42129a45f"><div class="ttname"><a href="data__type_8h.html#ab13729f7d29cc8284965c7c42129a45f">MatDf</a></div><div class="ttdeci">Matf&lt; Eigen::Dynamic, Eigen::Dynamic &gt; MatDf</div><div class="ttdoc">Dynamic MxN Eigen float matrix. </div><div class="ttdef"><b>Definition:</b> data_type.h:111</div></div>
<div class="ttc" id="structWaypoint_html"><div class="ttname"><a href="structWaypoint.html">Waypoint</a></div><div class="ttdoc">Waypoint base class. </div><div class="ttdef"><b>Definition:</b> waypoint.h:23</div></div>
<div class="ttc" id="poly__solver_8h_html_a16c877e610ae28aec1b360b621bcfe31"><div class="ttname"><a href="poly__solver_8h.html#a16c877e610ae28aec1b360b621bcfe31">PolySolver2D</a></div><div class="ttdeci">PolySolver&lt; 2 &gt; PolySolver2D</div><div class="ttdoc">PolySolver for 2D. </div><div class="ttdef"><b>Definition:</b> poly_solver.h:57</div></div>
<div class="ttc" id="classPolySolver_html_a18b1d7df17bc4c1d97c98448e1cc44bd"><div class="ttname"><a href="classPolySolver.html#a18b1d7df17bc4c1d97c98448e1cc44bd">PolySolver::ptraj_</a></div><div class="ttdeci">std::shared_ptr&lt; PolyTraj&lt; Dim &gt; &gt; ptraj_</div><div class="ttdoc">Solved trajectory. </div><div class="ttdef"><b>Definition:</b> poly_solver.h:53</div></div>
<div class="ttc" id="poly__solver_8h_html_a72e2c516357976f331e97006c7abeef8"><div class="ttname"><a href="poly__solver_8h.html#a72e2c516357976f331e97006c7abeef8">PolySolver3D</a></div><div class="ttdeci">PolySolver&lt; 3 &gt; PolySolver3D</div><div class="ttdoc">PolySolver for 3D. </div><div class="ttdef"><b>Definition:</b> poly_solver.h:60</div></div>
<div class="ttc" id="data__type_8h_html_a6b9210d48a0a541940af71827aad1b41"><div class="ttname"><a href="data__type_8h.html#a6b9210d48a0a541940af71827aad1b41">vec_E</a></div><div class="ttdeci">std::vector&lt; T, Eigen::aligned_allocator&lt; T &gt; &gt; vec_E</div><div class="ttdoc">Pre-allocated std::vector for Eigen using vec_E. </div><div class="ttdef"><b>Definition:</b> data_type.h:53</div></div>
<div class="ttc" id="classPolySolver_html_a794e1d7a1ce70b497a76aa92415757d3"><div class="ttname"><a href="classPolySolver.html#a794e1d7a1ce70b497a76aa92415757d3">PolySolver::solve</a></div><div class="ttdeci">bool solve(const vec_E&lt; Waypoint&lt; Dim &gt;&gt; &amp;waypoints, const std::vector&lt; decimal_t &gt; &amp;dts)</div><div class="ttdoc">Solve the trajector as defined in constructor. </div><div class="ttdef"><b>Definition:</b> poly_solver.cpp:23</div></div>
<div class="ttc" id="poly__traj_8h_html"><div class="ttname"><a href="poly__traj_8h.html">poly_traj.h</a></div><div class="ttdoc">Trajectory object for PolySolver. </div></div>
<div class="ttc" id="classPolySolver_html_a05e80fc467c2fd6ed86b2406b46cee8b"><div class="ttname"><a href="classPolySolver.html#a05e80fc467c2fd6ed86b2406b46cee8b">PolySolver::N_</a></div><div class="ttdeci">unsigned int N_</div><div class="ttdoc">Number of coefficients of a polynomial. </div><div class="ttdef"><b>Definition:</b> poly_solver.h:45</div></div>
<div class="ttc" id="classPolySolver_html_a9d8959bf5a5aa10e09eeff4fafad6412"><div class="ttname"><a href="classPolySolver.html#a9d8959bf5a5aa10e09eeff4fafad6412">PolySolver::PolySolver</a></div><div class="ttdeci">PolySolver(unsigned int smooth_derivative_order, unsigned int minimize_derivative, bool debug=false)</div><div class="ttdoc">Simple constructor. </div><div class="ttdef"><b>Definition:</b> poly_solver.cpp:4</div></div>
<div class="ttc" id="classPolySolver_html_a3354e2810ae6f83328e38feffba66619"><div class="ttname"><a href="classPolySolver.html#a3354e2810ae6f83328e38feffba66619">PolySolver::R_</a></div><div class="ttdeci">unsigned int R_</div><div class="ttdoc">Order of derivative to optimize. </div><div class="ttdef"><b>Definition:</b> poly_solver.h:47</div></div>
<div class="ttc" id="classPolySolver_html_a513264833fd583e3c4f70552d36c0fdc"><div class="ttname"><a href="classPolySolver.html#a513264833fd583e3c4f70552d36c0fdc">PolySolver::debug_</a></div><div class="ttdeci">bool debug_</div><div class="ttdoc">Enble output on screen. </div><div class="ttdef"><b>Definition:</b> poly_solver.h:51</div></div>
<div class="ttc" id="classPolySolver_html_a2848755828e352354d6740bde24e43ae"><div class="ttname"><a href="classPolySolver.html#a2848755828e352354d6740bde24e43ae">PolySolver::getTrajectory</a></div><div class="ttdeci">std::shared_ptr&lt; PolyTraj&lt; Dim &gt; &gt; getTrajectory()</div><div class="ttdoc">Get the solved trajectory. </div><div class="ttdef"><b>Definition:</b> poly_solver.cpp:18</div></div>
<div class="ttc" id="classPolySolver_html"><div class="ttname"><a href="classPolySolver.html">PolySolver</a></div><div class="ttdoc">Trajectory generator back-end class. </div><div class="ttdef"><b>Definition:</b> poly_solver.h:21</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
